flag_tests: bool,
flag_bench: Vec<String>,
flag_benches: bool,
+ flag_no_fail_fast: bool,
flag_frozen: bool,
flag_locked: bool,
arg_args: Vec<String>,
-q, --quiet No output printed to stdout
--color WHEN Coloring: auto, always, never
--message-format FMT Error format: human, json [default: human]
+ --no-fail-fast Run all benchmarks regardless of failure
--frozen Require Cargo.lock and cache are up to date
--locked Require Cargo.lock is up to date
options.flag_locked)?;
let ops = ops::TestOptions {
no_run: options.flag_no_run,
- no_fail_fast: false,
+ no_fail_fast: options.flag_no_fail_fast,
only_doc: false,
compile_opts: ops::CompileOptions {
config: config,
"));
}
+#[test]
+fn test_bench_no_fail_fast() {
+ if !is_nightly() { return }
+
+ let p = project("foo")
+ .file("Cargo.toml", &basic_bin_manifest("foo"))
+ .file("src/foo.rs", r#"
+ #![feature(test)]
+ extern crate test;
+ fn hello() -> &'static str {
+ "hello"
+ }
+
+ pub fn main() {
+ println!("{}", hello())
+ }
+
+ #[bench]
+ fn bench_hello(_b: &mut test::Bencher) {
+ assert_eq!(hello(), "hello")
+ }
+
+ #[bench]
+ fn bench_nope(_b: &mut test::Bencher) {
+ assert_eq!("nope", hello())
+ }"#);
+
+ assert_that(p.cargo_process("bench").arg("--no-fail-fast"),
+ execs().with_status(101)
+ .with_stderr_contains("\
+[RUNNING] target[/]release[/]deps[/]foo-[..][EXE]")
+ .with_stdout_contains("running 2 tests")
+ .with_stderr_contains("\
+[RUNNING] target[/]release[/]deps[/]foo-[..][EXE]")
+ .with_stdout_contains("test bench_hello [..]")
+ .with_stdout_contains("test bench_nope [..]"));
+}
+
#[test]
fn test_bench_multiple_packages() {
if !is_nightly() { return }